#include("common.html")
<html lang="en">
  
  <head>
    <meta charset="utf-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>商城</title>
    <meta name="description" content="商城">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="#(tpath)/static/css/element.css">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/css/basic.css">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/css/filter.css">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/city/zcity.css">
    <script src="#(tpath)/static/js/jquery.js"></script>
    <script src="#(tpath)/static/js/common.js"></script>
  </head>
  
  <body class="">
	#include("header.html")
    <style type="text/css">.main_con{ background: #fff; padding: 30px 0 100px; } .tmp_con{ height: 600px; margin: 0 auto; padding: 20px 0px; box-sizing: border-box; } .input_code{ width: 400px; float: left; } .input_code2{ width: 500px; } .img_code{ float: left; cursor: pointer; } .send_sms{ float: left; width: 100px; height: 40px; } .cl{ clear: both; } .cash_title{ font-size: 14px; position: relative; padding: 10px 20px; border-bottom: 1px solid #eee; } .stephead { width: 100%; height: 43px; position: relative; border-bottom: 1px solid #dfdfdf; margin: 30px 0 20px ; } .stephead h1 { font: 18px/36px "Microsoft Yahei"; color: #333; }</style>
    <div id="cash">
      <div class="main_con">
        <div class="allwarp">
          <div role="alert" class="el-alert el-alert--error is-light">
            <!---->
            <div class="el-alert__content">
              <span class="el-alert__title">请核实您的注册手机号码后，进行提现账户的设置</span>
              <!---->
              <!---->
              <i class="el-alert__closebtn el-icon-close"></i>
            </div>
          </div>
          <div class="stephead">
            <h1>请先输入图形验证码后，点击发送验证码到您的手机</h1></div>
          <div>
            <div class="input_code el-input el-input-group el-input-group--prepend">
              <div class="el-input-group__prepend">图形验证码</div>
              <input type="text" autocomplete="off" placeholder="请输入图形验证码" class="el-input__inner" id="captcha">
              <!---->
              <!---->
              <!---->
              <!----></div>
            <img src="#(base)/common/captcha/image" onclick="this.src='#(base)/common/captcha/image?'+Math.round(Math.random()*10);" width="100px" class="img_code">
            <div class="cl"></div>
          </div>
          <div style="margin-top: 10px;">
            <div class="input_code el-input el-input-group el-input-group--prepend">
              <div class="el-input-group__prepend">短信验证码</div>
              <input type="text" autocomplete="off" placeholder="请输入短信验证码" class="el-input__inner" id="code">
              <!---->
              <!---->
              <!---->
              <!----></div>
            <button type="button" class="el-button send_sms el-button--success el-button--small" id="sendCaptchaBtn" onclick="getVerify()">
              <!---->
              <!---->
              <span id="getCode">发送验证码</span></button>
            <div class="cl"></div>
          </div>
          <div class="stephead">
            <h1>请输入手机验证码后，设置收款账户</h1></div>
          <div role="radiogroup" class="el-radio-group" id="payCheck">
            <label role="radio" aria-checked="true" tabindex="0" class="el-radio is-checked" id="wechatCheck"  val="Wechat">
              <span class="el-radio__input is-checked">
                <span class="el-radio__inner"></span>
                <input type="radio" aria-hidden="true" tabindex="-1" class="el-radio__original" value="wechat"></span>
              <span class="el-radio__label">微信
                <!----></span></label>
            <label role="radio" tabindex="-1" class="el-radio"  id="alipayCheck"  val="Alipay">
              <span class="el-radio__input">
                <span class="el-radio__inner"></span>
                <input type="radio" aria-hidden="true" tabindex="-1" class="el-radio__original" value="alipay"></span>
              <span class="el-radio__label">支付宝
                <!----></span></label>
            <label role="radio" tabindex="-1" class="el-radio"  id="bankCheck"  val="Bank">
              <span class="el-radio__input">
                <span class="el-radio__inner"></span>
                <input type="radio" aria-hidden="true" tabindex="-1" class="el-radio__original" value="bank"></span>
              <span class="el-radio__label">银行卡
                <!----></span></label>
          </div>
          <div style="margin-top: 10px;display: none;" id="bankDiv">银行名称：
            <div class="input_code2 el-input">
              <!---->
              <input type="text" autocomplete="off" placeholder="输入银行名称" class="el-input__inner" id="inputBank">
              <!---->
              <!---->
              <!---->
              <!----></div>
            <br></div>
          <div style="margin-top: 10px;">收款账户：
            <div class="input_code2 el-input">
              <!---->
              <input type="text" autocomplete="off" placeholder="选择上面的收款账户类型，在此处输入账户信息或银行账户" class="el-input__inner" id="inputAccount">
              <!---->
              <!---->
              <!---->
              <!----></div>
            <br></div>
          <div style="margin-top: 10px;">收款姓名：
            <div class="input_code2 el-input">
              <!---->
              <input type="text" autocomplete="off" placeholder="输入收款人姓名" class="el-input__inner" id="inputName">
              <!---->
              <!---->
              <!---->
              <!----></div></div>
          <!-- <div style="margin-top: 10px;">收款备注：
            <div class="input_code2 el-input">
             
              <input type="text" autocomplete="off" placeholder="输入备注" class="el-input__inner">
             
             
             
             </div></div> -->
          <div style="margin-top: 20px;">
            <button type="button" class="el-button el-button--danger" id="quedingBtn">
              <!---->
              <!---->
              <span>确认并提交</span></button>
          </div>
        </div>
      </div>
    </div>
#include("footer.html")
  </body>

</html>
<script type="text/javascript">

var c=60;
var t;
var issend = false;
var returl = '';
function timedCount(){
    $('#getCode').html(c+"s");
    c=c-1;
    t=setTimeout("timedCount()",1000);
    if(c==0){
        stopCount();
    }
}

function stopCount(){
    clearTimeout(t);
    $('#getCode').html('发送验证码');
    issend = false;
    c=60;
}

function getVerify(){
    if(issend && c > 0){
        return;
    }
    var captcha = $("#captcha").val();
	if(captcha==""){
		alert('请输入验证码！');
		return false;
	}
	$.ajax({
        url: "#(base)/common/sms/sendAccount",
        type: "post",
        data: {"captcha":captcha},
        dataType: "json",
        success: function(res){
        	if(res.type=="success"){
			    issend = true;
			    timedCount();
       		}else{
       			alert(res.msg);
       		}
        },
        error: function(res){
        }
    });
}

$("#wechatCheck").on("click",function(){
	$("#wechatCheck").addClass("is-checked");
	$("#wechatCheck .el-radio__input").addClass("is-checked");
	$("#alipayCheck").removeClass("is-checked");
	$("#alipayCheck .el-radio__input").removeClass("is-checked");
	$("#bankCheck").removeClass("is-checked");
	$("#bankCheck .el-radio__input").removeClass("is-checked");
	$("#bankDiv").hide();
});
$("#alipayCheck").on("click",function(){
	$("#wechatCheck").removeClass("is-checked");
	$("#wechatCheck .el-radio__input").removeClass("is-checked");
	$("#alipayCheck").addClass("is-checked");
	$("#alipayCheck .el-radio__input").addClass("is-checked");
	$("#bankCheck").removeClass("is-checked");
	$("#bankCheck .el-radio__input").removeClass("is-checked");
	$("#bankDiv").hide();
	
});
$("#bankCheck").on("click",function(){
	$("#wechatCheck").removeClass("is-checked");
	$("#wechatCheck .el-radio__input").removeClass("is-checked");
	$("#alipayCheck").removeClass("is-checked");
	$("#alipayCheck .el-radio__input").removeClass("is-checked");
	$("#bankCheck").addClass("is-checked");
	$("#bankCheck .el-radio__input").addClass("is-checked");
	$("#bankDiv").show();
});
$("#quedingBtn").on("click",function(){
	var account = $("#inputAccount").val();
	if(account==""){
		alert("请输入账号");
		return;
	} 
	var name = $("#inputName").val();
	if(name==""){
		alert("请输入姓名");
		return;
	} 
	var bank = $("#inputBank").val();
	
	var code = $("#code").val();
	if(code==""){
		alert("请输入短信验证码");
		return;
	} 
	var paymentMethod = $("#payCheck").find("label.is-checked").attr("val");
	$.ajax({
        url: "#(base)/member/account/save",
        type: "post",
        data: {"accountName":name,"bankName":bank,"accountType":paymentMethod,"account":account,"code":code},
        dataType: "json",
        success: function(res){
        	if(res.type=="success"){
       			location.href="#(base)/member/withdraw/list"
       		}else{
       			alert(res.msg);
       		}
        },
        error: function(res){
        }
    });
});
</script>